<%--
  Created by IntelliJ IDEA.
  User: 86188
  Date: 2025/3/19
  Time: 11:21
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ page isELIgnored="false" %>  <%-- 确保 EL 表达式生效 --%>

<!DOCTYPE html>
<html lang="zh-CN">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>学生考勤系统 - 登录</title>
  <link href="${pageContext.request.contextPath}/static/css/login.css" rel="stylesheet">
  <link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css" rel="stylesheet">
</head>
<body class="auth-container">
<div class="login-card">
  <div class="logo-section">
    <div class="logo">
      <i class="fas fa-fingerprint"></i>
    </div>
    <h1 class="system-title">学生考勤系统</h1>
  </div>

  <form id="loginForm" method="post"  action="${pageContext.request.contextPath}/LoginServlet">
    <!-- 在用户名输入框前添加这段代码 -->
    <div class="form-group select-group">
      <i class="fas fa-user-tie input-icon"></i>
      <label for="role">
        <select name="role" id="role" class="form-control" required>
        <option value="Admin" selected>管理员</option>
        <option value="Teacher">老师</option>
        <option value="Student">学生</option>
      </select></label>
    </div>

    <div class="form-group">
      <i class="fas fa-user input-icon"></i>
      <input type="text" name="username" placeholder="员工编号" required>
    </div>

    <div class="form-group">
      <i class="fas fa-lock input-icon"></i>
      <input type="password" name="password" placeholder="登录密码" required>
    </div>

    <button type="submit" class="btn-login" id="login-btn">立即登录</button>
  </form>

<%--  <div class="extra-links">--%>
<%--    <a href="#forgot-password">忘记密码？</a>--%>
<%--    <span class="link-separator">|</span>--%>
<%--    <a href="#register">新员工注册</a>--%>
<%--  </div>--%>
</div>

<%--<script>--%>
<%--  // JS代码可保持原样或提取到外部文件--%>
<%--  document.getElementById('login-btn').addEventListener('click', function(e) {--%>
<%--    const role = document.getElementById('role').value;--%>


<%--    // 构造带views目录的路径--%>

<%--    const targetPath = window.location.origin--%>
<%--            + '${pageContext.request.contextPath}/views/'--%>
<%--            + role + '.jsp';--%>
<%--    window.location.href = targetPath;--%>
<%--    // 保留原有效果--%>
<%--    // this.style.transform = 'scale(0.98)';--%>
<%--    // setTimeout(() => this.style.transform = 'scale(1)', 5000);--%>
<%--  });--%>

<%--</script>--%>
</body>
</html>

